Vue.component('myheader', {
    template: `<header class="container navbar-fixed-top ">
    <nav class="navbar navbar-default">
        <div class="container-fluid">
            <div class="navbar-header">
                <a class="navbar-brand" href="/admin/admin/adminindex.html">
                    <img alt="Brand" src="http://www.sinoiov.com/skin/new/img/logo.png">
                </a>
            </div>
            <!--分类开始-->
            <ul class="nav navbar-nav">
                <li ><a href="/admin/admin/adminindex.html" style="display:block;margin: 0  0 0 -23px; font-size: 18px;font-weight: 500;color: rgb(40 130 244);">后台管理系统</a></li>
                <li><a href="adminindex.html">系统首页</a></li>
                <li><a href="/admin/Mall/indexMall.html">前台商城</a></li>
                
            </ul>
            <ul class="nav navbar-nav  navbar-right">
            <li>
                    <form action="">
                        <input type="text" v-model="content" placeholder="搜索商品">
                        <button type="button" @click="search()">
                            <i class="fa fa-search"></i>
                        </button>
                    </form>
                </li>
            <li><a class="fa fa-user-o" style="color: #690cec" href="javascript:void(0)" @click="logOut()">退出登录</a></li>
            </ul>

        </div>
    </nav>
    </header>
`,data:function () {
        return {
            content:""
        }
    },
    methods:{
        logOut:function (){
            if (confirm("您确认要登出嘛?")){
                axios.post("/logOut").then(function (){
                    location.href="/login.html"
                })
            }
        },
        search:function () {
            //this代表当前自定义的模板组件 this.wd会去上面的data中找到wd
            location.href="/admin/admin/adminindexOne.html?content="+this.content;
        }
    }
})

let header_v = new Vue({
    el: "myheader"
})